/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-10
 * Time: 15:37
 */
import java.util.Scanner;
/* 请在这里填写答案 */
class Bird{
    private String color;
    private int size;
    Bird(){}
    Bird(String c,int s){
        color = c;
        size = s;
    }
    public String equals(Bird b2){
        if(this.color.compareTo(b2.color)==0&&this.size==b2.size){
            return "同一只鸟";
        }
        else{
            return "不同一只鸟";
        }
    }
}
public class Main{
    public static void main(String args[]){
        Scanner scan=new Scanner(System.in);
        Bird b1=new Bird(scan.next(),scan.nextInt());
        Bird b2=new Bird(scan.next(),scan.nextInt());
        System.out.println(b1.equals(b2));

    }
}
